package com.beans;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-17
 * Time: 23:10
 */
@Controller
// 将 Bean 注入到 UserBean 当中
public class UserBean {

    // 写个方法，返回 User
    @Bean
    public User user() {
        User user = new User();
        user.setId(1);
        user.setName("张三");
        return user;
    }
}
